import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;

public class judge extends JFrame implements ActionListener{
    JTextArea jta1,jta2;
    JButton jb;
    public judge(String s) {
        super(s);
        setLayout(new FlowLayout());
        setBounds(100,100,400,600);
        jta1=new JTextArea(10,10);
        jta2=new JTextArea(10,10);

        jb=new JButton("judge");
        jb.addActionListener(this);
        add(jta1);add(jta2);add(jb);

        setVisible(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }
    public static void main(String[] args) {
        judge a=new judge("judge");
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        // TODO Auto-generated method stub

        int t=Integer.parseInt(jta1.getText());
        if(t%2==0) {
            jta2.setText("偶数");
        }else {
            jta2.setText("奇数");
        }

    }
}
